<?php
	defined( "AZ_EXE_" ) or die ( "ERROR : CORE VARIABLE IS NOT DEFINED." );
	class Object {
		public function __construct(){}
		public function Object(){$this->__construct();}
	}
	class AZ extends Object{
		public function __construct(){}
		public function AZ(){$this->__construct();}
		public function loadController( $controllerName ){
			Import::controller( $controllerName );
			$classController = Basic::formatControllerName($controllerName) ;
			return new $classController(); 
		}
		public function loadModel( $modelName ){
			Import::model( $modelName );
			$classModel = Basic::formatModelName($modelName) ;
			return new $classModel(); 
		}
		public function redirect($controller= array()){
			if ( isset($controller) && is_array($controller) && !empty($controller) ){
				$url = array();
				foreach( $controller AS $key => $value ){
					$url[] = $key."=".$value;
				}
				$url = implode("&", $url);
				header("Location: ?".$url);
			}else{
				header("Location:" . $controller);
			}
		}
	}
?>